import javax.swing.tree.TreeNode;
import java.util.Arrays;
import java.util.Deque;
import java.util.LinkedList;
import java.util.Queue;

/**
 * @program: javase
 * @description:
 * @author: lld
 * @create: 2021-04-09 22:59
 **/
public class Test {

    public static void main(String[] args) {
//        char c='5';
//        int num=0;
//        num=c-'0';//char转int
//        System.out.println(num);
//        Deque<Integer> deque=new LinkedList<Integer>();
//        deque.addLast(1);
//        deque.addLast(2);
//        deque.addLast(3);
//        StringBuilder res = new StringBuilder();
//        System.out.println(res.toString().length());
//        System.out.println(deque.pop());
//        System.out.println(deque.removeLast());
        double v = myPow(3.0, 5);
        System.out.println(v);

    }
    public static double myPow(double x, int n) {
        long b = n;
        if(b < 0){
            x = 1 / x;
            b = - b;
        }
        double res = 1;
        while(b != 0){
            if(b % 2 != 0){
                res *= x;
            }
            b >>= 1;
            x *= x;
        }
        return res;
    }
}
